import java.awt.Font;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartFrame;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PiePlot3D;
import org.jfree.chart.title.TextTitle;
import org.jfree.data.general.DefaultPieDataset;

public class First {
    /**
     *  @param args ignored;
     */

    public static void main(String[] args) {
        DefaultPieDataset data = new DefaultPieDataset();
        data.setValue("Category 1",43.2);
        data.setValue("Category 2",27.9);
        data.setValue("Category 3",79.5);

        JFreeChart chart =ChartFactory.createPieChart(
           "简单图例",
                       data,
                true,//legend?
                true, //tooltips?
                false//URLs?

        );

        TextTitle textTitle =chart.getTitle();
        textTitle.setFont(new Font("黑体",Font.PLAIN,20));
        chart.getLegend().setItemFont(new Font("宋体",Font.PLAIN,12));

        ChartFrame frame =new ChartFrame("First",chart);
        frame.pack();
        frame.setVisible(true);


    }
}
